#!/bin/bash

source agora.sh

function agoraUnbDeploymentMatrix1()

{

  g_00=(  "grid"                                                         )
  g_01=(  "agora"           "en_US"   "Agora;espace;ouvert"              )
  g_02=(  "elegi"           "en_US"   "european;project"                    )
  g_03=(  "lirmm"           "en_US"   "laboratoire;informatique;robotique;microelectronique;montpellier")
  g_04=(  "master2007"      "en_US"   "Stagiaires;masterPro2007"       )
  g_05=(  "colibri"         "en_US"   "projet;STIC"              )
  g_06=(  "kayou"           "en_US"   "Equipe;departement;informatique;LIRMM")
  g_07=(  "cnfm"            "en_US"   "centre;national;formation;microelectronique" )
  g_08=(  "encore"          "en_US"   "encyclopedie;chimie;organique" )
  g_09=(  "eportfolio"      "en_US"   "portfolio;electronique"        )

  g_10=(  "lagrid"          "en_US"   "GRID;IBM"           )
  g_11=(  "unbgsd"	    "en_US"   "grupo de testes gsd-unb"	)

  u_01=(  "caio"        "caioriosb@gmail.com"                      )
  u_02=(  "alice"       "under.shadow.c@gmail.com"                    )
  u_03=(  "bob"           "under.shadow.c@gmail.com"                        )
  u_04=(  "charlie"            "under.shadow.c@gmail.com"                   )
  u_05=(  "joao"            "under.shadow.c@gmail.com"                   )
  u_06=( "maria" "under.shadow.c@gmail.com"                   )

}


#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+


function agoraUnbDeploymentScenario1()

{
   agoraUnbDeploymentMatrix1

  # agoraAddVO          "00"  "01"  "Agora"
  # agoraAddVO          "01"  "02"  "ELeGI"
  # agoraAddVO          "01"  "03"  "L.I.R.M.M"
  # agoraAddVO          "03"  "04"  "Master2007"
  # agoraAddVO          "03"  "05"  "Colibri"
  # agoraAddVO          "03"  "06"  "Kayou"
  # agoraAddVO          "03"  "07"  "C.N.F.M"
  # agoraAddVO          "02"  "08"  "EnCOrE"
   agoraAddVO          	"01"  "11"  "unbgsd"

   
  # mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_01[@]}    "Caio"
   #mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_02[@]}    "Alice"
  # mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_03[@]}    "Bob"
  # mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_04[@]}    "Charlie"
mmsMemberAdd        ${g_11[0]}  ${g_11[0]}     ${u_05[@]}    "joao"
mmsMemberAdd        ${g_11[0]}  ${g_11[0]}     ${u_06[@]}    "maria"
 

}







function agoraDeploymentMatrix1()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{


  g_00=(  "grid"                                                         )
  g_01=(  "agora"           "fr_FR"   "Agora;espace;ouvert"              )
  g_02=(  "elegi"           "en_US"   "european;project"                    )
  g_03=(  "lirmm"           "fr_FR"   "laboratoire;informatique;robotique;micro�lectronique;montpellier")
  g_04=(  "master2007"      "fr_FR"   "Stagiaires;masterPro2007"       )
  g_05=(  "colibri"         "fr_FR"   "projet;STIC"              )
  g_06=(  "kayou"           "fr_FR"   "�quipe;d�partement;informatique;LIRMM")
  g_07=(  "cnfm"            "fr_FR"   "centre;national;formation;micro�lectronique" )
  g_08=(  "encore"          "fr_FR"   "encyclop�die;chimie;organique" )
  g_09=(  "eportfolio"      "fr_FR"   "portfolio;�lectronique"        )

  g_10=(  "lagrid"          "fr_FR"   "GRID;IBM"           )




  g_77=(  "validationtest3"    "fr_FR"   "Groupe de test validation 3"  )
  g_78=(  "validationtest2"    "fr_FR"   "Groupe de test validation 2"  )
  g_79=(  "validationtest1"    "fr_FR"   "Groupe de test validation 1"  )
  
  g_84=(  "mygrpen_2"        "en_US"   "Test group C"            )
  g_85=(  "mygrpfr_2"        "fr_FR"   "Groupe de test C"        ) 
  g_86=(  "mygrpen_1"        "en_US"   "Test group B"            )
  g_87=(  "mygrpfr_1"        "fr_FR"   "Groupe de test B"        )
  g_88=(  "mygrphost_en"     "en_US"   "Main test group A"            )
  g_89=(  "mygrphost_fr"     "fr_FR"   "Groupe de test principal A"   )

  g_96=(  "socratesten2"    "en_US"   "Test group B"            )
  g_97=(  "socratestfr2"    "fr_FR"   "Groupe de test B"        )
  g_98=(  "socratesten1"    "en_US"   "Test group A"            )
  g_99=(  "socratestfr1"    "fr_FR"   "Groupe de test A"        )
  
  u_01=(  "pdugenie"        "dugenie@lirmm.fr"                      )
  u_02=(  "lemoisson"       "lemoisson@lirmm.fr"                    )
  u_03=(  "cerri"           "cerri@lirmm.fr"                        )
  u_04=(  "deng"            "dengamd@hotmail.com"                   )
  u_05=(  "zhang"           "hhzhangleibonne@hotmail.com"           )
  u_06=(  "maziani"         "erica_afro@yahoo.es"                   )
  u_07=(  "heidy"           "heidyjm@gmail.com"                     )
  u_08=(  "li"              "Haoyuan.Li@ema.fr"                     )
  u_09=(  "philippe"        "philippe@lirmm.fr"                     )
  u_10=(  "alison"          "ca@cs.st-andrews.ac.uk"                )
  u_11=(  "colaux"          "ccolaux@fundp.ac.be"                   )
  u_12=(  "krief"           "alain.krief@fundp.ac.be"               )
  u_13=(  "gouarderes"      "Guy.Gouarderes@iutbayonne.univ-pau.fr" )
  u_14=(  "bourreau"        "bourreau@lirmm.fr"                     )
  u_15=(  "paulin"          "paulin@lirmm.fr"                       )
  u_16=(  "sallantin"       "sallantin@lirmm.fr"                    )
  u_17=(  "lacouture"       "lacoutur@iutbayonne.univ-pau.fr"       )
  u_18=(  "henry"           "julie.henry@fundp.ac.be"               )

  u_19=( "jonquet"          "jonquet@lirmm.fr"                        )
  u_20=( "gouaich"          "Abdelkader.Gouaich@lirmm.fr"             )
  u_21=( "prost"            "JPPROST@fr.ibm.com"                      )
  u_22=( "viart"            "fviart@advancedsolutionsaccelerator.com" )
  u_23=( "luiss"            "luiss@cs.fiu.edu"                        )
  

  
# 3 cerri 
# 2 lemoisson
# 1 pdugenie




  u_74=(   "myvaltest_f"       "dugenie@lirmm.fr"                    )
  u_75=(   "myvaltest_e"       "dugenie@lirmm.fr"                    )
  u_76=(   "myvaltest_d"       "dugenie@lirmm.fr"                    )
  u_77=(   "myvaltest_c"       "dugenie@lirmm.fr"                    )
  u_78=(   "myvaltest_b"       "dugenie@lirmm.fr"                    )
  u_79=(   "myvaltest_a"       "dugenie@lirmm.fr"                    )
  
  u_81=(   "mytest_i"       "dugenie@lirmm.fr"                    )
  u_82=(   "mytest_h"       "dugenie@lirmm.fr"                    )
  u_83=(   "mytest_g"       "dugenie@lirmm.fr"                    )
  u_84=(   "mytest_f"       "dugenie@lirmm.fr"                    )
  u_85=(   "mytest_e"       "dugenie@lirmm.fr"                    )
  u_86=(   "mytest_d"       "dugenie@lirmm.fr"                    )
  u_87=(   "mytest_c"       "dugenie@lirmm.fr"                    )
  u_88=(   "mytest_b"       "dugenie@lirmm.fr"                    )
  u_89=(   "mytest_a"       "dugenie@lirmm.fr"                    )

  u_95=(   "socratest5"       "dugenie@lirmm.fr"                    )
  u_96=(   "socratest4"       "dugenie@lirmm.fr"                    )
  u_97=(   "socratest3"       "dugenie@lirmm.fr"                    )
  u_98=(   "socratest2"       "dugenie@lirmm.fr"                    )
  u_99=(   "socratest1"       "dugenie@lirmm.fr"                    )

}





#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraAddVO()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{
 
   Prefix="g_"
   Structa='\$\{${Prefix}${Index}\[0\]\}'
   Structb='\$\{${Prefix}${Index}\[\@\]\}'

   Index="${1}"
   eval GrA0=${Structa}

   Index="${2}"
   eval GrB0=${Structa}  
   eval GrBx=${Structb}
        
   eval gmsContainerCreate  ${GrA0}  ${GrA0}     ${GrBx}
   eval mmsMemberAdd        ${GrB0}  ${GrA0}     ${GrB0}    "caioriosb@gmail.com"  ${3}     
   eval aasRoleAssign       ${GrB0}  ${GrA0}     ${GrB0}    "aas"  "manager"
   eval aasRoleAssign       ${GrB0}  ${GrA0}     ${GrB0}    "mms"  "manager"
   eval aasRoleAssign       ${GrB0}  ${GrA0}     ${GrB0}    "gms"  "manager"

}



#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario1()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{
 
   agoraInstall        ${g_00[0]}  ${g_00[0]}

   agoraAddVO          "00"  "01"  "Agora"
   agoraAddVO          "01"  "02"  "ELeGI"
   agoraAddVO          "01"  "03"  "L.I.R.M.M"
   agoraAddVO          "03"  "04"  "Master2007"
   agoraAddVO          "03"  "05"  "Colibri"
   agoraAddVO          "03"  "06"  "Kayou"
   agoraAddVO          "03"  "07"  "C.N.F.M"
   agoraAddVO          "02"  "08"  "EnCOrE"




   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres initiaux (6/2/2007)
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_01[@]}    "Pascal.Dugenie"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_05[0]}  ${g_05[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_07[0]}  ${g_07[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_08[0]}  ${g_08[0]}     ${u_01[@]}    "Pascal"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_02[@]}    "Philippe.Lemoisson"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_02[@]}    "Phil"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_02[@]}    "Phil"
   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_02[@]}    "Phil"
   mmsMemberAdd        ${g_08[0]}  ${g_08[0]}     ${u_02[@]}    "Phil"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_02[@]}    "Phil"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_03[@]}    "Stefano.Cerri"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_03[@]}    "Stefano"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_03[@]}    "Stefano"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_03[@]}    "Stefano"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_04[@]}    "Shichun.Deng"
   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_04[@]}    "Deng"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_05[@]}    "Lei.Zhang"  
#   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_05[@]}    "Lei" 

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_06[@]}    "Christiana.Maziani" 
#   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_06[@]}    "Christiana"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_07[@]}    "He�dy.Jean-Marie"
#   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_07[@]}    "He�dy" 
   
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_08[@]}    "Haoyuan.Li"
#   mmsMemberAdd        ${g_04[0]}  ${g_04[0]}     ${u_08[@]}    "Haoyuan"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_11[@]}    "Catherine.Colaux"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_11[@]}    "Catherine"
   mmsMemberAdd        ${g_08[0]}  ${g_08[0]}     ${u_11[@]}    "Catherine"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_13[@]}    "Guy.Gouard�res"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_13[@]}    "Guy"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_14[@]}    "Eric.Bourreau"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_14[@]}    "Eric"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_14[@]}    "Eric"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_15[@]}    "Mathias.Paulin"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_15[@]}    "Mathias"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_15[@]}    "Mathias"

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_16[@]}    "Jean.Sallantin"
   mmsMemberAdd        ${g_03[0]}  ${g_03[0]}     ${u_16[@]}    "Jean"
   mmsMemberAdd        ${g_06[0]}  ${g_06[0]}     ${u_16[@]}    "Jean"


}




#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioEncore()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

{


   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres krief et henry dans agora, colaux mms manager
   #---~~---.~---~~---.~---~~---.~---~~---+

#  mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_12[@]}    "Alain.Krief"

  mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_18[@]}    "Julie.Henry"

#  aasRoleAssign       ${g_08[0]}  ${g_08[0]}     ${u_11[0]}    "mms" "manager"


}




#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioHRSInit()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

{

   agoraDeploymentMatrix1

   hrsInit          ${g_01[0]} ${g_00[0]} # agora
   hrsInit          ${g_02[0]} ${g_01[0]} # elegi
   hrsInit          ${g_03[0]} ${g_01[0]} # lirmm 
   hrsInit          ${g_04[0]} ${g_03[0]} # master2007
   hrsInit          ${g_05[0]} ${g_03[0]} # colibri
   hrsInit          ${g_06[0]} ${g_03[0]} # kayou
   hrsInit          ${g_07[0]} ${g_03[0]} # cnfm
   hrsInit          ${g_08[0]} ${g_02[0]} # encore

   hrsInit          ${g_98[0]} ${g_98[0]} # socratesten2  
   hrsInit          ${g_99[0]} ${g_99[0]} # socratestfr1

}



#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioGMSInit()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

{

   agoraDeploymentMatrix1

   gmsInit          ${g_01[0]} ${g_00[0]} # agora
   gmsInit          ${g_02[0]} ${g_01[0]} # elegi
   gmsInit          ${g_03[0]} ${g_01[0]} # lirmm 
   gmsInit          ${g_04[0]} ${g_03[0]} # master2007
   gmsInit          ${g_05[0]} ${g_03[0]} # colibri
   gmsInit          ${g_06[0]} ${g_03[0]} # kayou
   gmsInit          ${g_07[0]} ${g_03[0]} # cnfm
   gmsInit          ${g_08[0]} ${g_02[0]} # encore

}











#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioTest1()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   local ThisRun=${1};
   
   agoraDeploymentMatrix1

   function addVOs_orig()
   {   
      agoraAddVO          "01"  "89"  "GroupePrincipal"
      agoraAddVO          "01"  "88"  "MainGroup"

      agoraAddVO          "89"  "87"  "GroupeFr1"
      agoraAddVO          "88"  "86"  "Group_En1"

      agoraAddVO          "89"  "85"  "GroupeFr2"
      
      agoraAddVO          "89"  "84"  "Group_En2"
     
   }
   

# Test de validation #########################################   

   function addVOs()
   {   
      agoraAddVO          "01"  "79"  "G1"
      agoraAddVO          "01"  "78"  "G2"
      agoraAddVO          "01"  "77"  "G3"
     
   }


   function membersAdd()
   {
     mmsMemberAdd        ${g_79[0]}  ${g_79[0]}     ${u_79[@]}    "a_G1"
     
     mmsMemberAdd        ${g_78[0]}  ${g_78[0]}     ${u_79[@]}    "a_G2"
     mmsMemberAdd        ${g_78[0]}  ${g_78[0]}     ${u_78[@]}    "b_G2"
     mmsMemberAdd        ${g_78[0]}  ${g_78[0]}     ${u_77[@]}    "c_G2"
     
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_79[@]}    "a_G3"
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_78[@]}    "b_G3"
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_77[@]}    "c_G3"    
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_76[@]}    "d_G3"     
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_75[@]}    "e_G3"       
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_74[@]}    "f_G3"       
     mmsMemberAdd        ${g_77[0]}  ${g_77[0]}     ${u_73[@]}    "g_G3"    

   }
# Fin de Test de validation #################################### 


   function membersAdd_orig()
   {
     mmsMemberAdd        ${g_89[0]}  ${g_89[0]}     ${u_89[@]}    "a_principal"
     mmsMemberAdd        ${g_89[0]}  ${g_89[0]}     ${u_88[@]}    "b_principal"

     mmsMemberAdd        ${g_88[0]}  ${g_88[0]}     ${u_87[@]}    "c_main"
     mmsMemberAdd        ${g_88[0]}  ${g_88[0]}     ${u_86[@]}    "d_main"

     mmsMemberAdd        ${g_87[0]}  ${g_87[0]}     ${u_89[@]}    "a_fr1"
     mmsMemberAdd        ${g_87[0]}  ${g_87[0]}     ${u_88[@]}    "b_fr1"
     mmsMemberAdd        ${g_87[0]}  ${g_87[0]}     ${u_87[@]}    "c_fr1"
     mmsMemberAdd        ${g_87[0]}  ${g_87[0]}     ${u_86[@]}    "d_fr1"

     mmsMemberAdd        ${g_86[0]}  ${g_86[0]}     ${u_89[@]}    "a_en1"
     mmsMemberAdd        ${g_86[0]}  ${g_86[0]}     ${u_88[@]}    "b_en1"
     mmsMemberAdd        ${g_86[0]}  ${g_86[0]}     ${u_87[@]}    "c_en1"
     mmsMemberAdd        ${g_86[0]}  ${g_86[0]}     ${u_86[@]}    "d_en1"

     mmsMemberAdd        ${g_85[0]}  ${g_85[0]}     ${u_89[@]}    "a_fr2"
     mmsMemberAdd        ${g_85[0]}  ${g_85[0]}     ${u_88[@]}    "b_fr2"
     mmsMemberAdd        ${g_85[0]}  ${g_85[0]}     ${u_87[@]}    "c_fr2"
     mmsMemberAdd        ${g_85[0]}  ${g_85[0]}     ${u_86[@]}    "d_fr2"

     mmsMemberAdd        ${g_84[0]}  ${g_84[0]}     ${u_89[@]}    "a_en2"
     mmsMemberAdd        ${g_84[0]}  ${g_84[0]}     ${u_88[@]}    "b_en2"
     mmsMemberAdd        ${g_84[0]}  ${g_84[0]}     ${u_87[@]}    "c_en2"
     mmsMemberAdd        ${g_84[0]}  ${g_84[0]}     ${u_86[@]}    "d_en2"


   }


   function credentialsSuppress()
   {
     aasCredentialsSuppress    ${g_88[0]}  ${g_88[0]}     ${u_86[@]}
     aasCredentialsSuppress    ${g_88[0]}  ${g_88[0]}     ${u_87[@]}

     aasCredentialsSuppress    ${g_89[0]}  ${g_89[0]}     ${u_88[@]}
     aasCredentialsSuppress    ${g_89[0]}  ${g_89[0]}     ${u_89[@]}

     aasCredentialsSuppress    ${g_89[0]}  ${g_89[0]}     ${g_84[@]}
     aasCredentialsSuppress    ${g_89[0]}  ${g_89[0]}     ${g_85[@]}
     aasCredentialsSuppress    ${g_88[0]}  ${g_88[0]}     ${g_86[@]}
     aasCredentialsSuppress    ${g_89[0]}  ${g_89[0]}     ${g_87[@]}
     aasCredentialsSuppress    ${g_01[0]}  ${g_01[0]}     ${g_88[@]}
     aasCredentialsSuppress    ${g_01[0]}  ${g_01[0]}     ${g_89[@]}

   }

   
   function containersDestroy()
   {

     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_89[0]}
     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_88[0]}

     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_87[0]}
     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_86[0]}

     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_85[0]}

     gmsContainerDestroy  ${g_01[0]}  ${g_01[0]}  ${g_84[0]}

   }






function addAll()
{
   addVOs

   echo > /tmp/testagora
   echo "addVOs ============================================" >> /tmp/testagora
   echo >> /tmp/testagora
   echo "/etc/passwd (mytest) ------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mytest" >> /tmp/testagora

   echo "/etc/passwd (mygrp) -------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mygrp"  >> /tmp/testagora

   echo "/etc/group ----------------------------------------" >> /tmp/testagora
   cat /etc/group  | grep "mygrp"  >> /tmp/testagora

   echo "/home/agora/groups --------------------------------" >> /tmp/testagora
   ll /home/agora/groups  | grep "mygrp"   >> /tmp/testagora
 
   echo "/home/agora/users --------------------------------" >> /tmp/testagora
   ll /home/agora/users   | grep "mytest"   >> /tmp/testagora

   membersAdd

   echo >> /tmp/testagora
   echo "membersAdd ========================================" >> /tmp/testagora
   echo >> /tmp/testagora
   echo "/etc/passwd (mytest) ------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mytest" >> /tmp/testagora

   echo "/etc/passwd (mygrp) -------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mygrp"  >> /tmp/testagora

   echo "/etc/group ----------------------------------------" >> /tmp/testagora
   cat /etc/group  | grep "mygrp"  >> /tmp/testagora

   echo "/home/agora/groups --------------------------------" >> /tmp/testagora
   ll /home/agora/groups  | grep "mygrp"   >> /tmp/testagora
 
   echo "/home/agora/users --------------------------------" >> /tmp/testagora
   ll /home/agora/users   | grep "mytest"   >> /tmp/testagora
}



function removeAll()
{

   credentialsSuppress

   echo >> /tmp/testagora
   echo "credentialSuppress ================================" >> /tmp/testagora
   echo >> /tmp/testagora
   echo "/etc/passwd (mytest) ------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mytest" >> /tmp/testagora

   echo "/etc/passwd (mygrp) -------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mygrp"  >> /tmp/testagora

   echo "/etc/group ----------------------------------------" >> /tmp/testagora
   cat /etc/group  | grep "mygrp"  >> /tmp/testagora

   echo "/home/agora/groups --------------------------------" >> /tmp/testagora
   ll /home/agora/groups  | grep "mygrp"   >> /tmp/testagora
 
   echo "/home/agora/users --------------------------------" >> /tmp/testagora
   ll /home/agora/users   | grep "mytest"   >> /tmp/testagora
   
   containersDestroy

   echo >> /tmp/testagora
   echo "containersDestroy =================================" >> /tmp/testagora
   echo >> /tmp/testagora
   echo "/etc/passwd (mytest) ------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mytest" >> /tmp/testagora

   echo "/etc/passwd (mygrp) -------------------------------" >> /tmp/testagora
   cat /etc/passwd | grep "mygrp"  >> /tmp/testagora

   echo "/etc/group ----------------------------------------" >> /tmp/testagora
   cat /etc/group  | grep "mygrp"  >> /tmp/testagora

   echo "/home/agora/groups --------------------------------" >> /tmp/testagora
   ll /home/agora/groups   | grep "mygrp"  >> /tmp/testagora

   echo "/home/agora/users --------------------------------" >> /tmp/testagora
   ll /home/agora/users   | grep "mytest"   >> /tmp/testagora
   
}


  if   [ "${ThisRun}" == "on" ]; then
  
     addAll

  elif [ "${ThisRun}" == "off" ]; then

     removeAll

  elif [ "${ThisRun}" == "both" ]; then
  
     addAll
     removeAll

  fi


  cat /tmp/testagora



}









#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioLAGRID_agora()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_01[@]}    "P.Dug�nie"
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_19[@]}    "C.Jonquet"
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_20[@]}    "A.Gouaich"
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_21[@]}    "JP.Prost"
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_22[@]}    "F.Viart"
   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_23[@]}    "Luiss"

}





#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenarioLAGRID()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{
 


   agoraDeploymentMatrix1

   agoraAddVO          "01"  "10"  "LAGRID"


   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres LAGRID
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_01[@]}    "P.Dug�nie"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_02[@]}    "Ph.Lemoisson"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_03[@]}    "S.A.Cerri"

   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_19[@]}    "C.Jonquet"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_20[@]}    "A.Gouaich"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_21[@]}    "JP.Prost"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_22[@]}    "F.Viart"
   mmsMemberAdd        ${g_10[0]}  ${g_10[0]}     ${u_23[@]}    "Luiss"

   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_01[0]}     "mms"  "manager"
   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_02[0]}     "mms"  "manager"
   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_03[0]}     "mms"  "manager"
   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_21[0]}     "mms"  "manager"
   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_22[0]}     "mms"  "manager"
   aasRoleAssign       ${g_10[0]}  ${g_10[0]}     ${u_23[0]}     "mms"  "manager"
   
}




















#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario2()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{
 
   agoraDeploymentMatrix1
 
   #---~~---.~---~~---.~---~~---.~---~~---+
   # ePortfolio
   #---~~---.~---~~---.~---~~---.~---~~---+
 
   agoraAddVO          "01"  "09"  "ePortfolio"
   mmsMemberAdd        ${g_09[0]}  ${g_09[0]}     ${u_01[@]}    "Pascal"
   mmsMemberAdd        ${g_09[0]}  ${g_09[0]}     ${u_13[@]}    "Guy"

}




#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario3()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   agoraDeploymentMatrix1

   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres Colibri
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_09[@]}    "Fabrice.Philippe"


   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_01[0]}     "aas"  "manager"
   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_01[0]}    "mms"  "manager"
   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_01[0]}     "gms"  "manager"
   mmsMemberAdd        ${g_05[0]}  ${u_01[0]}     ${u_09[@]}    "Fabrice"

}



#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario3a()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   agoraDeploymentMatrix1

   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres Colibri
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_97[@]}    "Pascal"
   mmsMemberAdd        ${g_05[0]}  ${g_05[0]}     ${u_97[@]}    "Pascal"

}

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario3b()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   agoraDeploymentMatrix1

   #---~~---.~---~~---.~---~~---.~---~~---+
   # Privil�ges Colibri
   #---~~---.~---~~---.~---~~---.~---~~---+

   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_97[0]}     "aas"  "manager"
   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_97[0]}     "mms"  "manager"
   aasRoleAssign       ${g_05[0]}  ${g_05[0]}     ${u_97[0]}     "gms"  "manager"
   
}



#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario4()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   agoraDeploymentMatrix1

   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres ELeGI
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_10[@]}    "Colin_Alison"
   mmsMemberAdd        ${g_02[0]}  ${g_02[0]}     ${u_10[@]}    "Colin"

}



#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+

function agoraDeploymentScenario5()

#---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---.~---~~---+
{

   agoraDeploymentMatrix1

   #---~~---.~---~~---.~---~~---.~---~~---+
   # Membres ePortfolio
   #---~~---.~---~~---.~---~~---.~---~~---+

   mmsMemberAdd        ${g_01[0]}  ${g_01[0]}     ${u_17[@]}    "Jerome_Lacouture"
   mmsMemberAdd        ${g_09[0]}  ${g_09[0]}     ${u_17[@]}    "Jerome"

}

